package Tiles;

import java.util.ArrayList;
import java.util.List;

import javax.swing.ImageIcon;

import Logic.GameEngine;
import Models.Player;

public class Tile {
	String identifier;
	String description;
	private ImageIcon label;
	
	private List<Player> playersParked = new ArrayList<Player>();
			
	private int x, y;	
	
	public Tile() {
	}
	
	public Tile(int x, int y, ImageIcon label) {
		this.x = x;
		this.y = y;
		this.label = label;
	}
	
	public void addPlayer (Player p){
		playersParked.add(p);
		p.setTile(this);
	}
	
	public void removePlayer (Player p){
		playersParked.remove(p);
	}
	
	public void setX(int x){
		this.x = x;		
	}
	
	public int getX(){
		return x;
	}
	public void setY(int y){
		this.y = y;
	}
	
	public int getY(){
		return y;
	}
	
	public void setLabel(ImageIcon label){
		this.label = label;
	}
	
	public ImageIcon getLabel(){
		return label;
	}

	public void rule(GameEngine ge) {
		
	}
	
	@Override
	public String toString() {
		return "id: " + identifier + "label: " + label;
	}
}

